len() returns the length of a string.
def strlen1(s):
length = len(s)
return length
| Function Call | Return Value | |||
|---|---|---|---|---|
| strlen1('Car') | → | |||
| strlen1('') | → | |||
| strlen1('5') | → | |||
| strlen1('Elephant') | → | |||
| strlen1('Roses') | → | |||
Experiment with this code on Gitpod.io